<div class="main-content">

    <div class="container-fluid">
        <div class="row justify-content-center">
            <div class="col-12 col-lg-10 col-xl-8">


                <form class="my-5">


                    <div class="row">

                        <div class="col-12">

                            <div class="form-group a-field valid dynamic require" a-field-type="input" a-field-length="64" a-field-name="title">

                                <label>
                                    商品名称 * 必填
                                </label>

                                <input type="text" class="form-control a-field-main" required placeholder="" value="{{detail.title}}">

                            </div>

                        </div>

                        <div class="col-12">

                            <div class="form-group a-field valid require" a-field-type="input" a-field-length="60" a-field-name="details.titlecn">

                                <label>
                                    商品名称-中文
                                </label>

                                <input type="text" class="form-control a-field-main" placeholder="" value="{{detail.details.titlecn}}">

                            </div>

                        </div>

                        <div class="col-4">

                            <div class="form-group a-field require valid" a-field-type="select" a-field-length="255" a-field-name="categoryid">
                                <label>
                                    所属分类 * 必选
                                </label>

                                <select class="form-control a-field-main input-c" data-toggle="select" data-options='{"minimumResultsForSearch": -1,"placeholder":"{i18n{ manager.category }i18n}"}' id="categoryid">
                                    <option disabled="disabled" selected="selected" value="">{i18n{ manager.category }i18n}</option>

                                    ||loop??categoryList??<option value='{{uid}}'>{{title}}</option>loop||

                                </select>
                            </div>

                        </div>
                        <div class="col-12">

                            <div class="form-group a-field valid" a-field-type="input" a-field-length="200" a-field-name="description">

                                <label>
                                    商品简介
                                </label>

                                <textarea class="form-control a-field-main" data-toggle="autosize" rows="1" placeholder="Try typing something...">{{detail.description}}</textarea>

                            </div>
                        </div>


                        <div class="col-6 col-md-4">
                            <div class="form-group a-field valid dynamic" a-field-type="number" a-field-length="8" a-field-name="price">
                                <label>标价($) * 必填</label>
                                <small class="form-text text-muted">
                                    折扣前的标准价格 如:<span style="text-decoration: line-through;">$100</span>
                                </small>

                                <input type="number" class="w-xs form-control a-field-main" placeholder="" value="{{detail.price}}">
                            </div>
                        </div>


                        <div class="col-6 col-md-4">
                            <div class="form-group a-field valid dynamic" a-field-type="number" a-field-length="8" a-field-name="sale">
                                <label>售价($) * 必填</label>
                                <small class="form-text text-muted">
                                    商品最终的真实售价
                                </small>

                                <input type="number" class="w-xs form-control a-field-main" placeholder="" value="{{detail.sale}}">
                            </div>
                        </div>

                        <div class="col-6 col-md-4">
                            <div class="form-group a-field valid dynamic" a-field-type="number" a-field-length="5" a-field-name="stock">
                                <label>库存 * 必填</label>
                                <small class="form-text text-muted">
                                    商品的有效库存数量
                                </small>

                                <input type="number" class="w-xs form-control a-field-main" placeholder="" value="{{detail.stock}}">
                            </div>
                        </div>

                    </div>




                    <div class="form-group a-field require valid a-field-switch dynamic" a-field-switch="cover,gallery,video,audio" a-field-type='input' a-field-length="255" a-field-name="cover" id="uploadContainer">

                        <label class="mb-1">封面 * (jpg,gif,png,jpeg格式)</label>

                        <small class="form-text text-muted">
                            建议尺寸 800x800 5M以内 最大10M
                        </small>

                        <div class="card">
                            <div class="card-body">

                                <div class="avatar avatar-xxl">
                                    <img id="imagePreview" src="{{detail.cover}}!m" alt="..." class="avatar-img rounded">
                                </div>

                                <div class="input-group my-3">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text" id="cover-url">{i18n{url}i18n}:</span>
                                    </div>
                                    <input id="image" type="text" disabled="disabled" class="form-control a-field-main" placeholder="请点击选择图片按钮开始上传" value="{{detail.cover}}" readonly aria-describedby="cover-url">
                                </div>

                                <input class="btn btn-sm btn-secondary" type="button" id="broseImage" value="选择图片">

                            </div>
                        </div>

                    </div>



                    <div class="form-group a-field valid a-field-switch" a-field-switch="gallery" a-field-type='input' a-field-length="2048" a-field-name='gallery' a-field-convert="JSON" id="galleryContainer">
                        <div class="row"></div>
                        <label>{i18n{ manager.gallery }i18n} </label>

                        <small class="form-text text-muted">
                            建议3-5张 最多15张 建议尺寸 800 x 800
                        </small>

                        <div class="card">
                            <div class="card-body">

                                <div class="" id="fileList"></div>

                                <div class=" pull-none-xs m-r m-b p-a-xs b-a">

                                    <div id="galleryList" class="swipe list-group list-group-lg list-group-flush list ">

                                    </div>

                                    <input id="gallery" type="text" disabled="disabled" class="form-control a-field-main mb-3" placeholder="请先{i18n{ manager.chooseFile }i18n}，选择完毕后点击上传按钮" value='{{detail.gallery}}'>

                                    <input class="btn btn-sm btn-secondary" type="button" id="brosweFiles" value="{i18n{ manager.chooseFile }i18n}">
                                    <input class="btn btn-sm btn-outline-primary" type="button" id="uploadFiles" value={i18n{ manager.upload }i18n}>

                                </div>
                            </div>
                        </div>

                    </div>


                    <div class="form-group a-field valid" a-field-type="summernote" a-field-length="100000" a-field-name="introduce">

                        <label>
                            详情介绍
                        </label>

                        <small class="form-text text-muted">
                            详情介绍可以使用排版工具
                        </small>

                        <small class="form-text text-muted">

                        </small>

                        <div class="box m-b-md">
                            <div id="summerNote" class='a-field-main'>{{detail.introduce}}</div>
                        </div>

                    </div>


                    <hr class="my-5">


                    <div class="row">

                        <div class="col-6 col-md-4 form-group a-field valid dynamic" a-field-type="input" a-field-length="5" a-field-name="sort">
                            <label>优先排序 </label>
                            <small class="form-text text-muted">
                                数字越大越靠前
                            </small>
                            <input type="number" class="w-xs form-control a-field-main" placeholder="" value="{{detail.sort}}" data-mask="0000">
                        </div>

                    </div>

                    <hr class="mt-5 mb-5">

                    <div class="row">

                        <div class="col-12 col-md-6 mb-3">
                            <a class="btn btn-block btn-primary" onclick="MANAGER.update( null, '{{detail.uid}}' , 'CommerceProduct', MANAGER.chooseCall )">
                                <i class="fe fe-send"></i> 更新
                            </a>
                        </div>

                    </div>

                </form>

            </div>
        </div>
    </div>

</div>

